/*
 *  Copyright 2019-2020 Zheng Jie
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *  http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */
package me.zhengjie.gs.domain;

import lombok.Data;
import cn.hutool.core.bean.BeanUtil;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.copier.CopyOptions;
import javax.persistence.*;
import javax.validation.constraints.*;
import java.io.Serializable;

/**
 * @website https://eladmin.vip
 * @description /
 * @author yun
 * @date 2024-02-20
 **/
@Entity
@Data
@Table(name="g_shelves")
public class GShelves implements Serializable {
    
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "`gs_id`")
    @ApiModelProperty(value = "货架编号")
    private Integer gsId;
    
    @Column(name = "`gs_name`",nullable = false)
    @NotBlank
    @ApiModelProperty(value = "货架名称")
    private String gsName;
    
    @Column(name = "`gs_style`",nullable = false)
    @NotBlank
    @ApiModelProperty(value = "货架样式")
    private String gsStyle;
    
    @Column(name = "`gs_img`",nullable = false)
    @NotBlank
    @ApiModelProperty(value = "轮播图")
    private String gsImg;
    
    @Column(name = "`gs_image`",nullable = false)
    @NotBlank
    @ApiModelProperty(value = "背景图片")
    private String gsImage;
    
    @Column(name = "`gs_type`",nullable = false)
    @NotBlank
    @ApiModelProperty(value = "货架类型")
    private String gsType;
    
    @Column(name = "`gs_imagepath`")
    @ApiModelProperty(value = "背景图片名称")
    private String gsImagepath;
    
    public void copy(GShelves source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
